using System.Collections.Generic;

namespace WorkFlowCore.BusinessDemo.Web.Models
{
    /// <summary>
    /// 验证用户模型
    /// 对应WorkFlowCore中的AuthorizationUser
    /// </summary>
    public class VerifyUserModel
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public string Id { get; set; }
        
        /// <summary>
        /// 用户名称
        /// </summary>
        public string Name { get; set; }
        
        /// <summary>
        /// 是否是管理员
        /// </summary>
        public bool IsManager { get; set; }
        
        /// <summary>
        /// 应用ID
        /// </summary>
        public string AppId { get; set; }
    }

    /// <summary>
    /// 验证声明模型
    /// 对应System.Security.Claims.Claim
    /// </summary>
    public class VerifyClaimModel
    {
        /// <summary>
        /// 声明类型
        /// </summary>
        public string Type { get; set; }
        
        /// <summary>
        /// 声明值
        /// </summary>
        public string Value { get; set; }
    }

    /// <summary>
    /// 验证输出模型
    /// 对应WorkFlowCore中的VerifyOutput
    /// </summary>
    public class VerifyOutputModel
    {
        /// <summary>
        /// 是否验证通过
        /// </summary>
        public bool IsValid { get; set; }
        
        /// <summary>
        /// 用户信息
        /// </summary>
        public VerifyUserModel User { get; set; }
        
        /// <summary>
        /// 额外的身份信息
        /// </summary>
        public IEnumerable<VerifyClaimModel> Claims { get; set; }
    }
}
